package model;
import java.util.ArrayList;

public class OOMethod extends OOObject {
	public OOClass returnType;
	public String code="";
	public boolean IsAbstract;
	public boolean IsSynchronized;
	public boolean isIsSynchronized() {
		return IsSynchronized;
	}

	public void setIsSynchronized(boolean isSynchronized) {
		IsSynchronized = isSynchronized;
	}

	public boolean isIsAbstract() {
		return IsAbstract;
	}

	public void setIsAbstract(boolean isAbstract) {
		IsAbstract = isAbstract;
	}

	public ArrayList<OOAttribute> parameters;
	public ArrayList<OOAttribute> variables;
	public ArrayList<OOMethod> methods;
		
	public OOMethod() {
		parameters = new ArrayList<OOAttribute>();
		variables = new ArrayList<OOAttribute>();
		methods = new ArrayList<OOMethod>();
	}
	
	public void addParameter(OOAttribute parameter) {
		parameters.add(parameter);
	}
	
	public OOAttribute getParameterAt(int index) {
		return parameters.get(index);
	}
	
	public int getParametersCount() {
		return parameters.size();
	}
	
	public void removeParameterAt(int index) {
		parameters.remove(index);
	}
	
	public void addMethod(OOMethod method) {
		methods.add(method);
	}
	
	public OOMethod getMethodAt(int index) {
		return methods.get(index);
	}
	
	public int getMethodsCount() {
		return methods.size();
	}
	
	public void removeMethodAt(int index) {
		methods.remove(index);
	}
	
	public void addVariable(OOAttribute variable) {
		variables.add(variable);
	}
	
	public OOAttribute getVariableAt(int index) {
		return variables.get(index);
	}
	
	public int getVariablesCount() {
		return variables.size();
	}
	
	public void removeVariableAt(int index) {
		variables.remove(index);
	}
}
